home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1988 December / Ahoy_Magazine_88-12_1988_Double_L.d64 / Unjumbled Words (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  460b  |  15 lines

  1. 0 poke53280,1:print"[147]"tab(12)"unjumbled words"
  2. 1 rem ==================================
  3. 2 rem    commodares problem #55-3 :
  4. 3 rem       unjumbled words
  5. 4 rem    solution by
  6. 5 rem       wallace leeker
  7. 6 rem    (based on a solution to
  8. 7 rem   problem #24-1 by allan flippin)
  9. 8 rem ==================================
  10. 100 input s$: n=len(s$): dim c(n-1)
  11. 110 i=n-1: print s$,
  12. 120 s$=left$(s$,i-1)+right$(s$,n-i)+mid$(s$,i,1)
  13. 130 c(i)=c(i)+1: if c(i)<=n-i goto 110
  14. 140 c(i)=0: if i>1 then i=i-1: goto 120
  15.